Skip to content

Conversation

@rhshadrach
Copy link
Member

@rhshadrach rhshadrach commented Nov 30, 2025

We have a similar issue when grouping by NumPy arrays. Here, there is no cheap .copy(deep=False) we can use; always copying can be expensive. This case makes me think we should just document "don't do this" in general.

@jorisvandenbossche
Copy link
Member

I think it is still worth merging, since it doesn't cost that much. It is certainly in the area of "just don't do that", but eg for ser = pd.Series(<arr vs ser>, copy=False), we have a similar difference for a numpy array vs series: for the series object, we still guarantee CoW protection, for the array the user can modify it at their own risk.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

BUG: Inconsistent behavior with groupby and copy-on-write

2 participants